#pragma once

#include "qlib/all.h"

namespace qbe::ShowHideLayerCell {

struct ShowHideLayerCellModel {
  void updateShowHide() {
    // m_hide_cells.clear();
    // std::map<std::shared_ptr<qlib::Cell>, std::vector<std::shared_ptr<qlib::Reference>>> cell_refs;
    // for (auto [e, ref] : current_cell->reg.view<qlib::Reference::s_ptr>().each()) {
    //   auto iter = cell_refs.find(ref->cell);
    //   if (iter == cell_refs.end()) {
    //     cell_refs.insert({ref->cell, {ref}});
    //   } else {
    //     iter->second.push_back(ref);
    //   }
    //   if (ref->cell->is_hide == true) {
    //     m_hide_cells.insert(ref->cell);
    //   }
    // }

    // //处理最顶层单元被隐藏
    // if (current_cell->is_hide == true) {
    //   // current_cell->reg.clear();
    //   return;
    // }

    // if (m_display_level == 0) {
    //   //处理0层级状态
    //   // current_cell->reg.clear();
    //   return;
    // }
  }
  void setDisplayLevel(unsigned level) { m_display_level = level; }

  // std::set<std::shared_ptr<qlib::Cell>> m_hide_cells;
  std::shared_ptr<qlib::Cell> current_cell;

  unsigned m_display_level = 100;

  std::vector<std::any> grpahs;
};

}  // namespace qbe::ShowHideLayerCell